/**
 * @(#)TimeModelParentTempleteDAOImpl.java 2017年2月9日
 * Copyright(C) 2017 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.dao.ITimeModelParentTempleteDAO;
import org.jsbd.boss.domian.channel.TimeModelParentTemplete;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * 基础模板
 * 
 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
 * @version 1.0.0
 */
@Service
public class TimeModelParentTempleteDAOImpl extends CrackBaseDao implements ITimeModelParentTempleteDAO {
	public static final Logger LOGGER = LoggerFactory.getLogger(TimeModelParentTempleteDAOImpl.class);


	@Override
	public Integer insertTemplete(TimeModelParentTemplete templete) {
		return super.update("qy_time_model_parent_template.INSERT_MODEL_TEMPLETE", templete);
	}

	@Override
	public Map<String, Object> selectTempletePageListMap(TimeModelParentTemplete form) {
		form = (form == null ? new TimeModelParentTemplete() : form);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("total", super.queryForCount("qy_time_model_parent_template.GET_LIST_COUNT", form));
		map.put("rows", super.queryForList("qy_time_model_parent_template.GET_LIST", form));
		return map;
	}

	@Override
	public TimeModelParentTemplete selectTemplete(TimeModelParentTemplete form) {
		List<TimeModelParentTemplete> list = super.queryForList("qy_time_model_parent_template.GET_TEMPLETE", form);
		if (list != null) {
			return list.get(0);
		}
		return null;
	}

	@Override
	public List<TimeModelParentTemplete> selectAllTemplete(TimeModelParentTemplete form) {
		return super.queryForList("qy_time_model_parent_template.GET_TEMPLETE_LIST", form);
	}

	
	@Override
	public Integer updateTemplete(TimeModelParentTemplete templete) {
		return super.update("qy_time_model_parent_template.UPDATE_TIME_MODEL", templete);
	}

	/* (non-Javadoc)
	 * @see org.jsbd.boss.dao.ITimeModelParentTempleteDAO#deleteTemplete(java.lang.String)
	 */
	@Override
	public void deleteTemplete(Integer id) {
		super.delete("qy_time_model_parent_template.DELETE_TIME_MODEL", id);
	}
}
